package com.chy.service.impl;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chy.common.R;
import com.chy.entity.User;
import com.chy.entity.UserInfo;
import com.chy.mapper.UserInfoMapper;
import com.chy.mapper.UserMapper;
import com.chy.service.UserInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Slf4j
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements UserInfoService {

    @Override
    public R<String> updateUserInfo(Map<String, Object> params) {
        String s = JSON.toJSONString(params);
        UserInfo userInfo = JSON.parseObject(s, UserInfo.class);

        boolean flag = this.updateById(userInfo);
        return flag ? R.success() : R.error();
    }
}
